<template>
  <div class="container" ref="containerRef"></div>
</template>

<script lang="ts" setup>
import * as echarts from 'echarts'
import { onMounted, ref } from 'vue'
const containerRef = ref()

onMounted(() => {
  const myEcharts = echarts.init(containerRef.value)

  const option = {
    xAxis: {
      data: [1, 2, 3, 4]
    },
    yAxis: {},
    series: {
      type: 'line',
      data: [20, 10, 30, 30]
    }
  }
  myEcharts.setOption(option)
})
</script>

<style scoped>
.container {
  width: 800px;
  height: 400px;
}
</style>
